473,461 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

mouseover function not work on firefox with dynamic created dropdown menu

The following code is dynamic create dropdownmenu which data within pulled from database
However, the code work well on IE but not on Firefox. On Firefox, the whole mouseover and mouseout function din't work. what is not supported on Firefox? the javascript syntax? please help as i am not familiar with javascript. thanks in advanced. this is quite urgent.... please..

By the way hope there has somebody may help me find out why the design may not in proper way like in IE for Firefox. the padding and space between table and table all not in proper.... why is it happen? hope somebody may find out from HTML i provide here.

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3.  Private Sub fnBindDataUser()
  4.         Dim conn As SqlConnection
  5.         Dim ds As DataSet
  6.         conn = New SqlConnection(ConfigurationManager.AppSettings("ConnectionStringTest"))
  7.         conn.Open()
  8.         Try
  9.             ds = SqlL.ExecuteDataset(conn, CommandType.Text, "SELECT * FROM tblCT")
  10.             fnCreateAddressDataGrid(ds)
  11.         Catch ex As Exception
  12.             clsCommon.MsgBox(Me, "Message", ex.Message & " msg3")
  13.             ds = Nothing
  14.         Finally
  15.             conn.Close()
  16.         End Try
  17.         dgUser.DataSource = ds
  18.         dgUser.DataBind()
  19.         dgUser.Font.Underline = False
  20.     End Sub
  21.  
  22.   Private Sub fnCreateAddressDataGrid(ByVal dsUser As DataSet)
  23.         Dim dr As DataRow
  24.         Dim boldisp As Boolean
  25.         Dim bolbgimg As Boolean
  26.         boldisp = False
  27.         bolbgimg = False
  28.         For Each dr In dsUser.Tables(0).Rows
  29.             Dim I As Integer = 0
  30.             Dim dgAddress As New DataList
  31.             Dim col As BoundColumn = New BoundColumn()
  32.             Dim tcl1 As TemplateColumn = New TemplateColumn()
  33.             Dim tcl2 As TemplateColumn = New TemplateColumn()
  34.             dgAddress.ID = "dgAddress_" & dr("CustTID").ToString
  35.             'Image
  36.             Dim btnImg As Image = New Image
  37.             Dim aImg As HtmlAnchor = New HtmlAnchor
  38.             Dim tblItem As Table = New Table
  39.             Dim tr As TableRow = New TableRow
  40.             Dim tc As TableCell = New TableCell
  41.             btnImg.ID = "bntImgAddress_" & dr("CustTID").ToString
  42.             aImg.ID = "aImgAddress_" & dr("CustTID").ToString
  43.             '  aImg.HRef = "products/product.aspx?CID=" & CID & "&cuid=" & dr("CustTID").ToString 'dr("CustTGatewayURL").ToString
  44.             aImg.HRef = dr("CustTGatewayURL").ToString
  45.             aImg.Target = "_blank"
  46.             btnImg.ImageUrl = dr("CustTImgGateway").ToString
  47.             aImg.Controls.Add(btnImg)
  48.  
  49.             If boldisp = False Then
  50.                 dgAddress.Attributes.Add("style", "display:block")
  51.                 tblItem.Attributes.Add("style", "display:block")
  52.                 aImg.Style.Value = "display:block"
  53.                 boldisp = True
  54.             Else
  55.                 dgAddress.Attributes.Add("style", "display:none")
  56.                 tblItem.Attributes.Add("style", "display:none")
  57.                 aImg.Style.Value = "display:none"
  58.             End If
  59.             col.HeaderText = "Address"
  60.             col.DataField = "Address"
  61.             dgAddress.ItemTemplate = New CreateItemTemplateLinkBtn("lnkBtn", "Message", "doLink", "lblCustTID", bolbgimg, "lblnew")
  62.             If bolbgimg = False Then
  63.                 bolbgimg = True
  64.             Else
  65.                 bolbgimg = False
  66.             End If
  67.             AddHandler dgAddress.ItemDataBound, AddressOf dgAddress_ItemDataBound
  68.             AddHandler dgAddress.ItemCommand, AddressOf dgAddress_ItemCommand
  69.  
  70.             dgAddress.DataSource = fnBindDataAddress(dr("CustTID").ToString)
  71.             dgAddress.DataBind()
  72.             dgAddress.Width = "748"
  73.             dgAddress.Height = "82"
  74.             dgAddress.ItemStyle.Width = "155"
  75.             dgAddress.ItemStyle.Wrap = True
  76.             dgAddress.ItemStyle.VerticalAlign = VerticalAlign.Top
  77.             dgAddress.ItemStyle.HorizontalAlign = HorizontalAlign.Left
  78.             dgAddress.Font.Name = "Arial"
  79.             dgAddress.Font.Size = "8"
  80.             dgAddress.RepeatLayout = RepeatLayout.Table
  81.             dgAddress.RepeatDirection = RepeatDirection.Horizontal
  82.             dgAddress.RepeatColumns = 5
  83.             dgAddress.CellPadding = "0"
  84.             dgAddress.CellSpacing = "0"
  85.             dgAddress.Style.Value = "text-align:top;"
  86.  
  87.             Dim arrColor() As String
  88.             arrColor = Split(dr("CustTTabColor").ToString, ",")
  89.  
  90.             tblItem.BackColor = System.Drawing.Color.FromArgb(arrColor(0), arrColor(1), arrColor(2))
  91.             tblItem.ID = "tblItem" & dr("CustTID").ToString
  92.             tc.Controls.Add(dgAddress)
  93.             tr.Controls.Add(tc)
  94.             tblItem.Controls.Add(tr)
  95.  
  96.             tr.Width = "748"
  97.             tr.Height = "80"
  98.             tr.Style.Value = "vertical-align:top;text-align:top;"
  99.  
  100.             tblItem.CellPadding = "0"
  101.             tblItem.CellSpacing = "0"
  102.             phAddress.Controls.Add(tblItem)
  103.             phBannerImg.Controls.Add(aImg)
  104.  
  105.         Next
  106.     End Sub
  107.  
  108.   Protected Sub dgUser_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles dgUser.ItemDataBound
  109.         If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then
  110.             Dim tblUser As Table = CType(e.Item.FindControl("tblUser"), Table)
  111.             Dim lblUserID As Label = CType(e.Item.FindControl("lblUserID"), Label)
  112.             Dim lnkCustType As LinkButton = CType(e.Item.FindControl("lbCustTypeName"), LinkButton)
  113.             tblUser.Attributes.Add("onmouseover", "jshow( 'tblItem" & lblUserID.Text & "','tblItem','aImgAddress_" & lblUserID.Text & "','aImgAddress_');")     
  114.             tblUser.Attributes.Add("onmouseout", "jshow( 'tblItem" & lblUserID.Text & "','tblItem','aImgAddress_" & lblUserID.Text & "','aImgAddress_');")        tblUser.BackImageUrl = CType(e.Item.FindControl("lblimg"), Label).Text
  115.         End If
  116.     End Sub
  117.  
  118.  
[HTML]
<script type="text/javascript">
function jshow(id, idname,imgid, imgidname)
{
var div = document.getElementById('div');
var child = div.childNodes;
var numchild = child.length;
var ctlname;
var obj;
var divimg = document.getElementById('divimg');
var childimg = divimg.childNodes;
var numchildimg = childimg.length;
var ctlimgname;
var objimg;

for(var i = 0; i < numchild; i++)
{
ctlname = child[i].id;
if (ctlname.indexOf(idname) >= 0)
{
child[i].style.display = 'none';
}
}
for(var j = 0; j < numchildimg; j++)
{
ctlimgname = childimg[j].id;
if(typeof ctlimgname == 'string')
{
if (ctlimgname.indexOf(imgidname) >= 0)
{
childimg[j].style.display = 'none';
}
}
}

obj = document.getElementById(id);
obj.style.display = 'block';
objimg = document.getElementById(imgid);
objimg.style.display = 'block';

}
</script>

<div id="div">
<asp:DataList ID="dgUser" Width="748px" runat="server" RepeatDirection="Horizontal" RepeatColumns="5" ItemStyle-VerticalAlign="Top" cellspacing="0" cellpadding="0" ItemStyle-HorizontalAlign="Left" >
<ItemTemplate>
<asp:Table runat="server" id="tblUser" style="display:block;cursor:pointer; width: 100%; font-family: Arial; font-size: 9pt; font-weight: 700; height: 30px;" cellspacing="0" cellpadding="0">
<asp:TableRow Visible="false" >
<asp:TableCell Width="100%">
<asp:Label ID="lblUserID" ForeColor="White" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CustTID")%>' ></asp:Label>
</asp:TableCell>
<asp:TableCell Width="100%">
<asp:Label ID="lblBanner" ForeColor="White" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CustTImgGateway")%>' ></asp:Label>
</asp:TableCell>
<asp:TableCell Width="100%">
<asp:Label ID="lblBannerURL" ForeColor="White" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CustTGatewayURL")%>' ></asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="trCustTT" >
<asp:TableCell id="tcCustTI" ColumnSpan="3">
&nbsp;&nbsp;<asp:LinkButton ID="lbCustTName" ForeColor="White" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CustTName")%>' CommandName ="SelectCustType" CommandArgument='<%#DataBinder.Eval(Container.Data Item, "CustTID")%>'></asp:LinkButton>
</asp:TableCell>
<asp:TableCell Visible="false" Width="100%">
<asp:Label ID="lblimg" ForeColor="White" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CustTTabImg")%>' ></asp:Label>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</ItemTemplate>
</asp:DataList>
<asp:PlaceHolder ID="phAddress" runat="server" Visible="true">
</asp:PlaceHolder>
</div>
[/HTML]
Mar 10 '08 #1
1 2681
acoder
16,027 Expert Mod 8TB
Can you show the client-side version of this? Are there any errors?
Mar 10 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: amohajer | last post by:
what does eval function do in javascript language and what are its usages?
9
by: Kim | last post by:
Hi I'm trying to do something like this. for(i=0; i<5; i++){ var theData = document.createElement('a'); theData.onmouseover = function() { return get(i);} ... ... }
3
by: marcbinaus | last post by:
Hi, I have 3 textboxes A B C The user can only enter single digit numbers in the textboxes, and if they hover over a blank textbox it would give them the options through a tooltip of what...
2
by: Calvin KD | last post by:
Hi everyone, Can someone show me or point me in the right direction as how to create a "dropdown menu" which displays the menu items as a separete layer over the top of the contents of the page...
5
by: JB | last post by:
I am struggling to figure out a way to allow one element to be dragged, but still capture 'mouseover' events on other elements. I've created a simple example to demonstrate what I mean:...
2
by: Amy | last post by:
<style> div.helpBtn{ font:bold 73% verdana; color:#995F8D; text-align:left; width:79px; height:24px; margin:0px; padding: 5px 0px 0px 27px; background:...
6
by: daveyand | last post by:
Hey Guys, I've stumped. I created a function that does various things to select boxes. Namely Get All selected indexes, populate array with these values
4
by: sbettadpur | last post by:
hello, i have created one website using div i.e total layout is designed using div only. if i saw that pages in Internet Explorer vesion 6, its showing very fine, but if i open same pages in...
2
by: markszlazak | last post by:
I'm a relatively slow response of table cells changing their background color with mouseover/our in IE6 (Win 2K) but the response is fine (fast) in Firefox. Why? The code is below. Sorry about the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.